package org.example.hospital_frontend.common;

/**
 * 自定义错误码
 */
public enum ErrorCode {
    SUCCESS("success!",0),
    PARAMS_ERROR("请求参数错误!",40000),
    NOT_LOGIN_ERROR("未登录!",40100),
    NO_AUTH_ERROR("无权限!",40200),
    NOT_FOUND_ERROR("未找到!",40400),
    FORBIDDEN_ERROR("禁止访问!",40300),
    SYSTEM_ERROR("系统错误!",50000),
    TOO_MANY_REQUEST("请求过于频繁!",41000),
    OPERATION_ERROR("操作失败!",42000);


    private final String msg;
    private final int code;

    ErrorCode(String msg, int code) {
        this.msg = msg;
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public int getCode() {
        return code;
    }
}
